package tech.edwardvan.mybatisplusdemo.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import tech.edwardvan.mybatisplusdemo.entity.User;
import tech.edwardvan.mybatisplusdemo.service.IUserService;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author EdwardVan
 */
@Api(tags = "用户模块")
@RestController
@RequestMapping("/mybatisplusdemo/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @GetMapping
    public Page<User> list(@RequestParam("page") Long current, @RequestParam("pageSize") Long size) {
        return userService.page(new Page<>(current, size));
    }
}
